<?php

namespace Controller\Ajax;

class Photo extends Base {

	public function addComment() {
		$this->mustLogin();
		$userId = $this->currentUserInfo['UserId'];
		$photoId = $this->postInt('photoId');
		$content = $this->postParam('content');
		try {
			\Business\Photo::instance()->addComment($userId, $photoId, $content);
			$this->response(true);
		} catch (\Lib\Exception\Business $e) {
			$this->responseError($e->getMessage(), $e->getCode());
		}
	}
}